<?php
    include "../../class/crop.class.php";
    include "../../function/functionPHP.php";
    /*echo "<pre>";
    print_r($_POST);
    echo "</pre>";*/
    
    $cropID=$_POST["cropID"];
    $incomeID=$_POST["incomeID"];
    $income=$_POST["income"];
    
    $cropClass=new crop($cropID);
    $crop=$cropClass->getCrop();
    $farmID=$crop["farmID"];    
    
    for($i=0;$incomeID[$i];$i++){
        $cropClass->setIncome($incomeID[$i], $income[$i]);
    }
?>
<!DOCTYPE html>
<html class="ui-mobile">
    <head>
        <title>Cost Analysis</title>
        <meta charset="utf-8">
        <script type="text/javascript">
            alert("บันทึกเรียบร้อย");
            location.replace('../../?page=member/crop/cropList&farmID=<?=$farmID?>');
        </script>
    </head>
</html>